<extend name="Layout/index" />

<script src="__PUBLIC__/jq/jquery-3.0.0.min.js"></script>

<block name="breadcrumb-01">
	<li>
		<i class="icon-home home-icon"></i>
		<a href="#">首页</a>
	</li>
	<li class="active">查看图书</li>
</block>

<block name="breadcrumb-02">
	<h1>
		<a href="<{:U('Module/index')}>">返回</a>
		<small>
			<i class="icon-double-angle-right"></i>
			 图书列表
		</small>
	</h1>
</block>
<block name='main'>
		<table class="table table-striped table-bordered table-hover">
			<thead>
			 <tr>
				<th>id</th>
				<th>书名</th>
				<th>作者</th>
				<th>图片</th>
				<th>操作</th>
			 </tr>
			</thead>
			<tbody>
			<volist name="mbook" id="vo">
				<tr id="<{$vo.id}>">
					<td><{$vo.id}></td>
					<td><{$vo.title}></td>
					<td><{$vo.writer}></td>
					<td><img src="__UPLOAD__/<{$vo.photo}>" style="width:30px"></td>
					<th>
						<a onclick = delajax(<{$vo.id}>,<{$vo.mid}>)>删除</a>
					</th>
				</tr>
			</volist>
			</tbody>
		</table>


		<script>

			function delajax(id,mid){
				$.ajax({
					url: "<{:U('Mbook/delajax',array('id'=>$vo['id'],'mid'=>$vo['mid']))}>",
					type: "post",
					data: {id:id,mid:mid},
					dataType: "json",
					success:function(result){
						 $("#"+id).remove();
					}
				})
			}
			
		</script>
</block>